Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

XSDuration in EWSUtilities fix#422

Merged
serious6 merged 2 commits intomasterfrom
unknown repository
Aug 30, 2015
Merged

XSDuration in EWSUtilities fix#422
serious6 merged 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 24, 2015

This pull request fixes the problem with wrong parsing of Bias in Period.(#357, #398 and #343)

Problem:

  • TimeSpan for this one -PT3H30M will be parsed as:
negative true
year 0
month 30
day 0
hour 3
minute 30
seconds 0
  • The big M for months and minutes seems to be correct according to ISO 8601 and the only difference is 'T' in the middle. For example this one P1Y2M10DT2H30M is a correct Time interval.

Fix:

  • For parsing of TimeSpan, an Joda-Time Period is now used instead of row Java Regex.
  • Period.parse() can automatically parse any value in form P1Y2M10DT2H30M, except of leading '-' symbol. For parsing '-' Java Regex is still used.
  • Two method getXSDurationToTimeSpan() and getXSDurationToTimeSpanValue() are merged in one getXSDurationToTimeSpan(), because Joda-Time can parse duration with years and months too.
  • Joda-Time can also parse values like PT2H100M59.0S, the minutes are bigger then 60. This duration will be parsed in to PT3H40M59.0S

Test:

  • Corresponding tests are added to new class TimeSpanUtilsTest

@azurecla
Copy link
Copy Markdown

Hi @itbw, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, AZPRBOT;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra blank lines.

@vboctor
Copy link
Copy Markdown
Contributor

vboctor commented Aug 24, 2015

Thanks @itbw for your contribution. 👍

@pathikrit
Copy link
Copy Markdown

👍

1 similar comment
@vbauer
Copy link
Copy Markdown
Contributor

vbauer commented Aug 27, 2015

👍

serious6 added a commit that referenced this pull request Aug 30, 2015
Fix: XSDuration in EWSUtilities (#357, #398, #343)
@serious6 serious6 merged commit e43d06a into OfficeDev:master Aug 30, 2015
@serious6
Copy link
Copy Markdown
Member

@itbw thanks for your contribution.

@serious6
Copy link
Copy Markdown
Member

referenced issues have been closed.

@serious6 serious6 added this to the 2.0 milestone Sep 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants